<?php 
Yii::app()->clientScript->registerScriptFile (Yii::app()->baseUrl.'/js/number/jquery.autotab-1.1b.js');

$script = <<<SCRIPT
	function updateUserName()
	{
		
		jQuery('#TblCustomer_loginID').val(jQuery('#A_AREACODE').val() + jQuery('#A_PREFIXCODE').val() + jQuery('#A_PHONENUMBER').val());
	}
	jQuery(document).ready(function(){
		jQuery('#A_AREACODE, #A_PREFIXCODE, #A_PHONENUMBER').autotab_magic().autotab_filter('numeric');
		jQuery('#A_ZIPCODE').autotab_filter('numeric');
		
		
		jQuery('#A_AREACODE').keyup(function(){ updateUserName(); });
		jQuery('#A_PREFIXCODE').keyup(function(){updateUserName(); });
		jQuery('#A_PHONENUMBER').keyup(function(){updateUserName(); });
		
	});
SCRIPT;
Yii::app()->clientScript->registerScript('myscript',$script,CClientScript::POS_READY);
?>

<script type="text/javascript">
	
</script>
<div class="p13t">
        <div  class="font20 yellow_color bo_b_d p5b">Registration</div>
        <div class="form_contact w750">
        
        <p class="p13b">
        	Denotes a required field (*)
        </p>
		<?php $form = $this->beginWidget('CActiveForm', array(
			'id' => 'signup-form',
			'enableClientValidation' => 'true',
			'clientOptions' => array(
				'validateOnSubmit' => true,
				),
		)); ?>
		<?php echo $form->errorSummary($model); ?>  
		
        <label class="float_left p5t yellow_color">
        	<?php echo $form->labelEx($model, 'areacode', array('label'=> 'Enter Your Phone Number :')); ?>
        </label>
        
        <div class="bg_txt1 float_left">
        	<?php echo $form->textField($model, 'areacode', array('id' => 'A_AREACODE', 'maxlength' => 3)); ?>
       	</div>
        <span class="yellow_color"> - </span>
        <div class="bg_txt1 float_left">
        	<?php echo $form->textField($model, 'prefixcode',array('id' => 'A_PREFIXCODE', 'maxlength' => 3)); ?>
       	</div>
        <span class="yellow_color"> - </span>
        <div class="bg_txt1 float_left">
        	<?php echo $form->textField($model, 'phonenumber',array('id' => 'A_PHONENUMBER', 'maxlength' => 4)); ?>
        </div>
        <div class="check">
        </div>
        <br class="cb" />
        
        
        
        <p class="p10b">Register your home phone number, cell number or any other number.</p>
        <p class="p10t yellow_color"><strong>Username &amp; Password </strong></p>
        <p class="p10b">Create a username &amp; password to access your account online. </p>
        
        <label class="float_left p5t"><?php echo $form->labelEx($model, 'loginID', array('label' => 'Username :')); ?></label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'loginID'); ?>
        </div>
        
        <br class="cb" />
        
        <label class="float_left p5t"><?php echo $form->labelEx($model, 'password', array('label' => 'Password :')); ?></label>
        <div class="bg_txt float_left"><?php echo $form->passwordField($model, 'password'); ?></div>
        <br class="cb" />
        
        <label class="float_left p5t"> <?php echo $form->label($model,'password_repeat',array('label' => 'Password confirmation')); ?></label>
        <div class="bg_txt float_left"><?php echo $form->passwordField($model, 'password_repeat'); ?></div>
        <br class="cb" />
        
         <label class="float_left p5t">How did you hear about us? </label>
        <div class="bg_txt2 float_left">
        	<?php echo $form->dropDownList($model, 'referredSource', CHtml::listData(TblReferenceSource::getAll(), 'referenceID', 'referenceSource')); ?>
		</div>
        <br class="cb" />
        
         <p class="p10t yellow_color"><strong>Name &amp; Billing Address </strong></p>
         
         <p class="p10b">Please enter the following information. </p>
         
         <label class="float_left p5t">
         	<?php echo $form->labelEx($model, 'firstName', array('label' => 'First name :')); ?>
         </label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'firstName'); ?>
        </div>
        <br class="cb" />
        
        
         <label class="float_left p5t"><?php echo $form->labelEx($model, 'lastName', array('label' => 'Last name :')); ?></label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'lastName'); ?>
        </div>
        <br class="cb" />
        
        
        <label class="float_left p5t">
        	<?php echo $form->labelEx($model, 'preferLanguageID', array('label' => 'Preferred Language :'));; ?>
        </label>
		<div class="bg_txt2 float_left">
			<?php echo $form->dropDownList($model, 'preferLanguageID', CHtml::listData(TblLanguages::getAll(), 'id', 'name')); ?>
		</div>
        <br class="cb" />
        
         <label class="float_left p5t">
         	<?php echo $form->labelEx($model, 'address', array('label' => 'Address:')); ?>
         </label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'address'); ?>
        </div>
        <br class="cb" />
        
        
        <label class="float_left p5t">
        	<?php echo $form->labelEx($model, 'city', array('label' => 'City:')); ?>
        </label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'city'); ?>
        </div>
        <br class="cb" />
        
        <label class="float_left p5t">
        	<?php echo $form->labelEx($model, 'stateID', array('label' => 'State:')); ?>
        </label>
        <div class="bg_txt2 float_left">
        	<?php echo $form->dropDownList($model, 'stateID', CHtml::listData(TblStateZip::getAll(), 'stateID', 'stateName')); ?>
		</div>
        <br class="cb" />
        
        
        <label class="float_left p5t">
        	<?php echo $form->labelEx($model, 'zipCode', array('label' => 'Zip Code:')); ?>
        </label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'zipCode', array('id' => 'A_ZIPCODE')); ?>
        </div>
        <br class="cb" />
        
        
        <p class="p10t yellow_color"><strong>Email </strong></p>
        <p class="p10b">Email is our primary means for contacting you. </p>
        <label class="float_left p5t">
        	<?php echo $form->labelEx($model, 'email', array('label' => 'Email :')); ?>
        </label>
        <div class="bg_txt float_left">
        	<?php echo $form->textField($model, 'email'); ?>
        </div>
        <br class="cb" />
        
      	<label class="float_left p5t">&nbsp;</label>
        <a class="bt_send float_left m10r" href="javascript:void(0);" onclick="document.forms[0].submit();">Register</a>
        <a class="bt_send float_left" href="javascript:void(0);" onclick="document.forms[0].reset(); ">Cancel</a> 
        </div>
        <div class="cb"></div>
<?php $this->endWidget(); ?>
</div>